//
//  QNCentralManager+Log.m
//  QNCentralModule
//
//  Created by donyau on 2018/11/19.
//  Copyright © 2018 Yolanda. All rights reserved.
//

#import "QNCentralManager+Log.h"
#import "QNCategory.h"

@implementation QNCentralManager (Log)

- (void)centralLogMessage:(NSString *)message {
    if (QNCentralManager.logPrefix) {
        [self logMessage:[@"centralLog: " stringByAppendingString:message]];
    }else {
        [self logMessage:message];
    }
}

@end


@implementation QNCentralManager (Scan)
static char QNCentralManagerScanningFlagKey;

- (void)setScanningFlag:(BOOL)scanningFlag {
    setAssociatedObject(QNCentralManagerScanningFlagKey, [NSNumber numberWithBool:scanningFlag])
}

- (BOOL)scanningFlag {
    NSNumber *number = getAssociatedObject(QNCentralManagerScanningFlagKey)
    if (number == nil) {
        number = [NSNumber numberWithBool:NO];
    }
    return [number boolValue];
}
@end



